﻿using System.ComponentModel.DataAnnotations;

namespace FlyingHat.Model.Models
{
    public class LibraryModel
    {
        public long Id { get; set; }
        /// <summary>
        /// 图书室名称
        /// </summary>
        [Required(ErrorMessage = "图书室名称不能为空"), StringLength(50, ErrorMessage = "图书室名称长度不能超过50个字符")]
        public string Name { get; set; } = string.Empty;

        /// <summary>
        /// 编号
        /// </summary>
        [Required(ErrorMessage = "图书室编号不能为空"), StringLength(50, ErrorMessage = "图书室编号长度不能超过50个字符")]
        public string Code { get; set; } = string.Empty;

        /// <summary>
        /// 位置
        /// </summary>
        [Required(ErrorMessage = "图书室位置不能为空"), StringLength(50, ErrorMessage = "图书室位置长度不能超过100个字符")]
        public string Location { get; set; } = string.Empty;

        /// <summary>
        /// 是否允许进入
        /// </summary>
        public bool IsOpen { get; set; }

        /// <summary>
        /// 书架集合
        /// </summary>
        public List<BookshelfModel> Bookshelfs { get; set; } = new List<BookshelfModel>();


    }

    public class ModifyLibraryModel : LibraryModel
    {
        /// <summary>
        /// 将要删除的书架
        /// </summary>
        public List<long> DeleteShelfId { get; set; } = new List<long>();
    }

}
